<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Answer Feedback</title>
</head>
<body>
<div id="b"><p><a href="/QSS/view/UserHome.jsp"><font color=#4682B4>Home</font></a></p></div>
<div id="e">
<p><a href="/QSS/view/Logout.jsp"><font color=#4682B4>Logout</font></a></p></div>
<div id="d">
<%

int Score = (Integer)request.getSession().getAttribute("score");
int QNum = (Integer)request.getSession().getAttribute("QNum");
// System.out.println("Answer:"+request.getSession().getAttribute("answer"));
// System.out.println("UserResponse:"+request.getParameter("userResponse"));
    if(request.getSession().getAttribute("answer").equals(request.getParameter("userResponse")))
    {
    	Score++;
    	request.getSession().setAttribute("score", Score);
%>
    <b>Correct Answer!!</b><br><br>
<%
    }
    else
    {
%>
    <b>Sorry, Answer is Incorrect.</b><br><br>
<%
    }
    QNum++;
request.getSession().setAttribute("QNum", QNum);
System.out.println(QNum);
%>
 <form method="post" action="PlayGame.jsp"> 
 <%
 if(QNum>10)
 {
 %>
  <input type = "submit" value="See Score"> 
  <%}
 else
 {
 %>

 <input type = "submit" value="Next Question"> 
 <%} %>
 </form> 
<!-- <input type="submit" value="Next Question" onClick="window.location.='PlayQuiz.jsp'" style = "height:100px; width:150px"> -->
</div>
</body>
</html>